/**
 * 程度选择
 */
import React from 'react';
import { Select } from 'antd';

const SelectTrain = React.forwardRef(({ value, onChange, code, ...rest }, ref) => (
    <Select
        style={{ width: 240 }}
        ref={ref}
        value={typeof value === 'number' ? String(value) : value}
        onChange={(_value, item = {}) => {
            const { props = {} } = item;
            const { children } = props;
            onChange(_value, children);
        }}
        placeholder="请选择"
        allowClear
        {...rest}
    >
        <Select.Option value="1">一般</Select.Option>
        <Select.Option value="2">良好</Select.Option>
        <Select.Option value="3">熟练</Select.Option>
        <Select.Option value="4">精通</Select.Option>
    </Select>
));

export default SelectTrain;
